var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, o) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var o in e)
              Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
          })(e, o);
      };
      return function (e, o) {
        function n() {
          this.constructor = e;
        }
        if ("function" != typeof o && null !== o)
          throw new TypeError(
            "Class extends value " + String(o) + " is not a constructor or null"
          );
        t(e, o),
          (e.prototype =
            null === o
              ? Object.create(o)
              : ((n.prototype = o.prototype), new n()));
      };
    })(),
  AXTaoYuanNameDialog = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        e.btn_sure.on(Laya.Event.CLICK, e, e.onSureNameAction),
        WebSocketService.addListener({
          caller: e,
          code: 13421,
          method: e.onLoadData,
        }),
        e
      );
    }
    return (
      __extends(e, t),
      (e.showDialog = function () {
        null == this.instance && (this.instance = new e()),
          (this.instance.input_name.text = ""),
          this.instance.popup(!0);
      }),
      (e.prototype.onSureNameAction = function () {
        var t = this.input_name.text;
        t.length < 2
          ? ToastView.toastView("名称太短了")
          : t.length > 4
          ? ToastView.toastView("名称太长了")
          : -1 == t.indexOf(" ")
          ? WebSocketService.send({ c: 13421, d: { mateName: t } })
          : ToastView.toastView("名称不能包含空格");
      }),
      (e.prototype.onLoadData = function (t) {
        ToastView.toastView(t.msg),
          0 == t.code &&
            (this.close(),
            WebSocketService.send({ c: 1333 }),
            AXTaoYuanListDialog.showDialog(2, t.data));
      }),
      e
    );
  })(ui.SquareController.AXTaoYuanNameDialogUI);
